import type { GoodListType } from '@/pages/modules/car/types'

// 购物车 / 结算页 满减响应参数
export interface CartFullReductionResponseParameters extends Pick<GoodListType, 'shopId'> {
  productType: ProductType
  productIds: Long[]
  fullReductionId: string
  fullReductionRules: FullReductionRules[]
}

export interface FullReductionRules {
  fullReductionRule: FullReductionRule
  conditionAmount: number //  满减条件金额
  discountAmount?: number // 优惠金额
  discountRatio?: number // 折扣比例
  orderDiscount?: number // 订单优惠金额
  id: string
}

export type ProductType = keyof typeof PRODUCT_TYPE

enum PRODUCT_TYPE {
  ALL_PRODUCT = '全部商品',
  SPECIFIED_PRODUCT_PARTICIPATE = '指定商品',
  SPECIFIED_PRODUCT_NOT_PARTICIPATE = '指定商品不参与',
}

export type FullReductionRule = keyof typeof FULL_REDUCTION_RULE

enum FULL_REDUCTION_RULE {
  FULL_REDUCTION = '满减',
  FULL_DISCOUNT = '满折',
}
